package com.example.demo.service.Impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.demo.entity.Admin;
import com.example.demo.entity.User;
import com.example.demo.mapper.UserMapper;
import com.example.demo.service.UserService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author shenrui
 * @date 2021/9/19
 * @description 实现UserService,继承ServiceImpl里面的增删改查方法
 */
@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements UserService {

    /**
     * 根据继承的getOne方法，查找是否有符合的user
     */
    @Override
    public User verifyUserLogin(User user) {
        return this.getOne(new LambdaQueryWrapper<User>().eq(User::getUsrAccount,user.getUsrAccount())
                .eq(User::getUsrPassword,user.getUsrPassword()));
    }


}

